#pragma once

#include "scoped_ptr.h"

#define PAN_PROC_INFO_FETCHER       _T("atom_proc_info_fetcher")

// Poke function id
enum {
    PFI_PROC_INFO_FETCHER_BASE                  = 400,

    // Param = PokeConfigCursor *, IOParam = bool
    PFI_SET_WATCH_PROC,

    // Param = PPSetConfig *, IOParam = bool
    PFI_GET_WATCH_PROC_INFO,

    // Param = PokeConfigCursor *, IOParam = bool
    PFI_GET_WATCH_PROC_INFO_2,

    // Param = PokeConfigCursor *, IOParam = bool
    PFI_GET_PROC_IMAGE_INFO,

    // Param = PPSetConfig *, IOParam = bool
    PFI_FETCH_PROC_INFO,

    // Param = PPSetConfig *, IOParam = bool
    PFI_FETCH_PROC_INFO_2,

    // Param = PPSetConfig *, IOParam = bool
    PFI_FETCH_PROC_IMAGE_INFO,
};

struct ProcInfo {
    DWORD m_nPid;
    CString m_strProcName;
    DWORD m_nThreadNum;
    DWORD m_nParentPid;

    ProcInfo() : m_nThreadNum(0), m_nParentPid(0) {}
};

struct ProcInfo2 {
    ProcInfo m_oBasicInfo;
    CString m_strExePath;
    CString m_strCmdLine;
    CString m_strWorkDir;
    CString m_strUser;
    DWORD m_nDepFlags;
    BOOL m_bDepPermanent;
    SYSTEMTIME m_oStartTime;
    FILETIME m_oTotalTime;
    FILETIME m_oKernelTime;
    FILETIME m_oUserTime;

    ProcInfo2() : m_oBasicInfo(), m_nDepFlags(0), m_bDepPermanent(FALSE)
    {
        memset(&m_oStartTime, 0, sizeof(SYSTEMTIME));
        memset(&m_oTotalTime, 0, sizeof(FILETIME));
        memset(&m_oKernelTime, 0, sizeof(FILETIME));
        memset(&m_oUserTime, 0, sizeof(FILETIME));
    }
};

struct ImageInfo {
    ScopedIcon m_hIcon;
    CString m_strExeDesc;
    CString m_strExeCompany;
    DWORD m_n1stVer;
    DWORD m_n2ndVer;
    DWORD m_n3rdVer;
    DWORD m_n4thVer;
    SYSTEMTIME m_oCreateTime;
    SYSTEMTIME m_oModifyTime;
    SYSTEMTIME m_oAccessTime;

    ImageInfo() : m_n1stVer(0), m_n2ndVer(0), m_n3rdVer(0), m_n4thVer(0)
    {
        memset(&m_oCreateTime, 0, sizeof(SYSTEMTIME));
        memset(&m_oModifyTime, 0, sizeof(SYSTEMTIME));
        memset(&m_oAccessTime, 0, sizeof(SYSTEMTIME));
    }
};
